package com.example.mapper.shopping;


import com.example.model.entity.shopping.Cart;
import com.example.model.vo.CartVO;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 操作Cart相关数据接口
*/
public interface CartMapper {

    /**
      * 新增
    */
    int insert(Cart Cart);

    /**
      * 删除
    */
    int deleteById(Integer id);

    /**
      * 修改
    */
    int updateById(Cart Cart);

    /**
      * 根据ID查询
    */
    Cart selectById(Integer id);

    /**
      * 查询所有
    */
    List<CartVO> selectAll(Cart Cart);

    @Select("select * from cart where userId = #{userId} and medicinesId = #{medicinesId} and medicinesStyleId=#{medicinesStyleId}")
    Cart selectByUserIdAndMedicinesId(Integer userId, Integer medicinesId, Integer medicinesStyleId);
    @Select("select * from cart where doctorId = #{doctorId} and medicinesId = #{medicinesId} and medicinesStyleId=#{medicinesStyleId}")
    Cart selectByDoctorIdAndMedicinesId(Integer doctorId, Integer medicinesId, Integer medicinesStyleId);
}
